<include file="Public/header" />
<script type="text/javascript">
function submit_delete_batch(){
    /* 获取选中的项 */
    var items = '';
    $('.checkitem:checked').each(function(){
        items += this.value + ',';
    });
    if(items != '') {
        items = items.substr(0, (items.length - 1));
        submit_delete(items);
    } else {
        alert('请选择要操作的对象');
    }
}

function submit_delete(id){
    if(confirm('确定要删除？')) {        
        $('#id').val(id);
        $('#list_form').submit();
    }
}
</script>
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>固件管理</h3>
      <ul class="tab-base">
        <li><a href="javascript:void(0);" class="current"><span>管理</span></a></li>
        <li><a href="{:U('Firmware/firmware_add')}"><span>新增</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form method="get" name="formSearch">
    <table class="tb-type1 noborder search">
      <tbody>
        <tr>
          <th>所属分类</th>
          <td>
            <select name="ver" id="ver" class="">
              <option value="">请选择...</option>
              <option value="cn" <if condition="$search['ver'] eq 'cn'">selected="selected" </if>  >中文</option>
              <option value="en" <if condition="$search['ver'] eq 'en'">selected="selected" </if>  >英文</option>
            </select>
          </td>
          <th>固件名称</th>
          <td><input type="text" value="{$search['name']}" name="name" class="txt" ></td>
          <th>所属分类</th>
          <td>
            <select name="class" id="class" class="">
              <option value="">请选择...</option>
              <option value="驱动包" <if condition="$search['class'] eq '驱动包'">selected="selected" </if>  >驱动包</option>
              <option value="BIOS和EC" <if condition="$search['class'] eq 'BIOS和EC'">selected="selected" </if>  >BIOS和EC</option>
              <option value="显示驱动程序" <if condition="$search['class'] eq '显示驱动程序'">selected="selected" </if>  >显示驱动程序</option>
              <option value="声卡驱动程序" <if condition="$search['class'] eq '声卡驱动程序'">selected="selected" </if>  >声卡驱动程序</option>
              <option value="USB串行ATA驱动程序" <if condition="$search['class'] eq 'USB串行ATA驱动程序'">selected="selected" </if>  >USB串行ATA驱动程序</option>
              <option value="芯片组" <if condition="$search['class'] eq '芯片组'">selected="selected" </if>  >芯片组</option>
              <option value="WiFi驱动程序" <if condition="$search['class'] eq 'WiFi驱动程序'">selected="selected" </if>  >WiFi驱动程序</option>
              <option value="网络驱动程序" <if condition="$search['class'] eq '网络驱动程序'">selected="selected" </if>  >网络驱动程序</option>
              <option value="蓝牙驱动程序" <if condition="$search['class'] eq '蓝牙驱动程序'">selected="selected" </if>  >蓝牙驱动程序</option>
              <option value="软件程序" <if condition="$search['class'] eq '软件程序'">selected="selected" </if>  >软件程序</option>
              <option value="USB端口驱动" <if condition="$search['class'] eq 'USB端口驱动'">selected="selected" </if>  >USB端口驱动</option>
              <option value="General Driver" <if condition="$search['class'] eq 'General Driver'">selected="selected" </if>  >General Driver</option>
              <option value="其它驱动程序" <if condition="$search['class'] eq '其它驱动程序'">selected="selected" </if>  >其它驱动程序</option>
              <option value="操作指南" <if condition="$search['class'] eq '操作指南'">selected="selected" </if>  >操作指南</option>
              <option value="指纹驱动" <if condition="$search['class'] eq '指纹驱动'">selected="selected" </if>  >指纹驱动</option>
              <option value="操作系统" <if condition="$search['class'] eq '操作系统'">selected="selected" </if>  >操作系统</option>
              <option value="固件" <if condition="$search['class'] eq '固件'">selected="selected" </if>  >固件</option>
            </select>
          </td>
          <td><a href="javascript:document.formSearch.submit();" class="btn-search tooltip" title="查询">&nbsp;</a></td>
        </tr>
      </tbody>
    </table>
  </form>
  <!-- 操作说明 -->
  <table class="table tb-type2" id="prompt">
    <tbody>
      <tr class="space odd">
        <th colspan="12" class="nobg"><div class="title">
            <h5>操作提示</h5>
            <span class="arrow"></span></div></th>
      </tr>
      <tr>
        <td>
        	<ul>
            	<li>可以查看发布的固件，可以对固件进行删除等操作</li>
            	<li>显示名称、所属类别、添加时间等</li>
          	</ul>
        </td>
      </tr>
    </tbody>
  </table>
  <form id="list_form" method='post' action="{:U('Firmware/firmware_del')}">
    <input id="firmware_id" name="firmware_id" type="hidden" />
    <table class="table tb-type2">
      <thead>
        <tr class="space">
          <th colspan="15" class="nobg">列表</th>
        </tr>
        <tr class="thead">
          <th class="w24"></th>
          <th class="w72">版本</th>
          <th class="align-center">固件类别</th>
          <th class="align-center">固件名称</th>
          <th class="align-center">固件描述</th>
          <th class="align-center">下载地址</th>
		  <th class="align-center">添加时间</th>
          <th class="w48 align-center">操作</th>
        </tr>
      </thead>
      <tbody>
        <notempty name="list">
        <volist name="list" id="val">
        <tr class="hover edit">
		  <td><input type="checkbox" value="{$val['id']}" class="checkitem"></td>
          <td class="w48 sort">{$val['ver']}</td>
          <td class="align-center">
            {$val['class']}
          </td>
          <td class="align-center">
            {$val['name']}
          </td>
          <td class="align-center">
            {$val['describe']}
          </td>
          <td class="align-center">
            <a href="{$val['download']}" target="_blank" >{$val['download']}</a>
          </td>
		  <!--<td class="align-center">{$val['goods_price']}</td>-->
          <!--<td class="align-center">{$val['goods_storage']}</td>-->
		  <td class="align-center">{$val['ctime']|date='Y-m-d H:i:s',###}</td>
		  <td class='w72 align-center'>
		  <a href="{:U('Firmware/firmware_edit',array('id'=>$val['id']))}">编辑</a> | <a href='javascript:if(confirm("确定要删除？"))window.location = "{:U('Firmware/firmware_del',array('id'=>$val['id']))}";'>删除</a>
		  </td>
        </tr>
        </volist>
        <else/>
        <tr class="no_data">
          <td colspan="10">暂无记录</td>
        </tr>
        </notempty>
      </tbody>
      <notempty name="list">
      <tfoot>
        <tr class="tfoot">
          <td>
            <!--<input type="checkbox" class="checkall" id="checkall_1">-->
          </td>
          <td id="batchAction" colspan="15">
          	<span class="all_checkbox">
            	<!--<label for="checkall_1">全选</label>-->
            	<!--<a href="javascript:void(0)" class="btn" onclick="submit_delete_batch();"><span>删除</span></a>-->
            </span>
            <div class="pagination">{$page_show}</div>
        </tr>
      </tfoot>
     </notempty>
    </table>
  </form>
</div>
<script type="text/javascript" src="__JS__/jquery.edit.js" charset="utf-8"></script> 
<include file="Public/footer" />